# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=udisks2
pkgver=2.9.4
pkgrel=1
pkgdesc="daemon, tools and libraries to manipulate disks"
options="!check"
url="https://www.freedesktop.org/wiki/Software/udisks/"
# s390x and riscv64 blocked by polkit
arch="all !s390x !riscv64"
license="GPL-2.0-or-later"
depends="dbus"
depends_dev="gobject-introspection-dev polkit-dev libatasmart-dev
	libgudev-dev acl-dev lvm2-dev"
makedepends="bash $depends_dev glib-dev intltool gtk-doc linux-headers libblockdev-dev
	btrfs-progs-dev coreutils"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-lang
	$pkgname-libs
	$pkgname-bash-completion:bashcomp:noarch
	"
source="https://github.com/storaged-project/udisks/releases/download/udisks-$pkgver/udisks-$pkgver.tar.bz2
	O_CLOEXEC.patch
	"
builddir="$srcdir"/udisks-$pkgver

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-lvm2 \
		--enable-lvmcache \
		--enable-btrfs \
		--disable-zram \
		--with-udevdir=/lib/udev
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/lib/*.a
}

libs() {
	pkgdesc="Dynamic library to access the udisks daemon"
	default_libs
	amove usr/lib/girepository*
}

sha512sums="
35f5429bc2a7092aa659cba9296837d127e2b17c23ab23111d0d9b230d15ef5a6965e112b1f3829748a69a52fb5b09722153f86f1ef70977b3ad7b7a4ec40ec5  udisks-2.9.4.tar.bz2
269ba55cc755e2a484670258bc530790691b66c9fce9479a2a17d78cff5d52dd1be89290979efd44a0ba82be665f52a356a57f2cbb67951d91fe09d4e24c2a6a  O_CLOEXEC.patch
"
